﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using ServiceStack.OrmLite;
using WebCoreAdmin.Models;

namespace WebCoreAdmin.Controllers
{
    [Authorize]
    public class AdminController : Controller
    {
        private OrmLiteConnectionFactory Fac { get; }
        public AdminController(OrmLiteConnectionFactory fac)
        {
            Fac = fac;
        }
        // GET
        public IActionResult Index()
        {
            using (var db=Fac.OpenDbConnection())
            {
                ViewData["Category"] = db.Select<CategoryViewModel>();
            }
         
            return View();
        }

        public IActionResult TaskLists()
        {
            return View();
        }
    }
}